package com.example.service.Impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.domain.Community;
import com.example.mapper.CommunityMapper;
import com.example.service.CommunityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class CommunityServiceImpl extends ServiceImpl<CommunityMapper, Community> implements CommunityService{
    @Autowired
    private CommunityMapper communityMapper;
    @Override
    public IPage<Community> getCommnunity(Integer pageCurrent, Integer pageSize) {
        IPage<Community> page = new Page<>(pageCurrent,pageSize);
        communityMapper.selectPage(page,null);
        return page;
    }

    @Override
    public IPage<Community> getPageCommunity(Integer page, Integer size) {
        IPage<Community> pageInfo = new Page<>(page,size);
        communityMapper.selectPage(pageInfo,null);
        return pageInfo;
    }
}
